package net.halflite.mzkr.entity;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * UserProfileエンティティクラス
 * 
 */
@Entity
public class UserProfile implements Serializable {

    private static final long serialVersionUID = 1L;

    /** 一行プロフール最大長 */
    public static final int MAX_SHORTPROFILE_LENGTH = 150;

    /** プロフール最大長 */
    public static final int MAX_PROFILE_LENGTH = 5000;

    /** idプロパティ */
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    public long id;

    /** registedUserIdプロパティ */
    public long registedUserId;

    /** shortProfileプロパティ */
    public String shortProfile;

    /** profileプロパティ */
    public String profile;

    /** associateIdプロパティ */
    public String associateId;

    /** createdプロパティ */
    @Column(updatable = false)
    @Temporal(TemporalType.TIMESTAMP)
    public Date created;

    /** modifiedプロパティ */
    @Temporal(TemporalType.TIMESTAMP)
    public Date modified;

    /** registedUser関連プロパティ */
    @ManyToOne
    @JoinColumn(name = "registed_user_id", referencedColumnName = "id")
    public RegistedUser registedUser;

    public UserProfile(long registedUserId) {
		this.registedUserId = registedUserId;
		created = new Date();
		modified = new Date();
	}
    
    public UserProfile() {
	}

}